#ifndef LOG_H_
#define LOG_H_

#include <Python.h>
#include "invocation.h"
#include <string>
#include <iostream>

class Log
{
private:
	bool verbose;
	bool debugMode;
	std::string progressStr;
	int progressCur;
	bool appending;
	PyObject *pNow;
	std::ostream &output;

	std::string now();

public:
	Log();
	void init();
	void provideArgs(Invocation &args)
	{
		verbose = args.verbose;
		debugMode = args.debug;
	}
	void error(std::exception &e);
	void error(std::string msg);
	void debug(std::string desc, std::string msg);
	void info(std::string msg, bool p = false);
	void progress(double x, double total = 1.0);
	void append(std::string msg);
	void reset();
};

extern Log logger;

#endif /* LOG_H_ */
